' ***********************************************************************
' Assembly         : Ioc
' Author           : Tim Ford
' Created          : 10-02-2013
'
' Last Modified By : Tim Ford
' Last Modified On : 10-02-2013
' ***********************************************************************
' <copyright file="MultipleInstance.vb" company="Red Baron Solutions">
'     Red Baron Solutions. All rights reserved.
' </copyright>
' <summary></summary>
' ***********************************************************************
Namespace Ioc
    Friend Class MultipleInstance
        Inherits BaseFactory

        Public Sub New(type As Type)
            m_Type = type
        End Sub
        Private m_Type As Type

        Public Sub New(instanceFactory As Func(Of Object))
            m_InstanceFactory = instanceFactory
        End Sub
        Private m_InstanceFactory As Func(Of Object)

        Public Overrides Function GetObject() As Object
            If m_InstanceFactory IsNot Nothing Then
                Return m_InstanceFactory
            Else
                Return ObjectFactory.Create(m_Type)
            End If
        End Function

    End Class
   
End Namespace
